package com.ss.android.article.base.feature.favorite;

import android.os.Bundle;
import android.view.View;
import com.ss.android.article.base.feature.feed.presenter.ArticleQueryObj;
import com.ss.android.article.base.feature.feed.presenter.ArticleQueryThread;
import com.ss.android.article.base.feature.feed.presenter.ArticleQueryHandler;
import com.ss.android.article.base.feature.model.CellRef;
import com.ss.android.article.browser.R;
import com.ss.android.model.BaseArticle;
import java.util.Collection;
import java.util.List;

public final class r extends ReadHistoryArticleListFragment {
    private ArticleQueryHandler mArticleQueryHandler;
    private int d;

    public r() {
        this.mArticleQueryHandler = new ArticleQueryHandler(this);
    }

    public final void onFinishQuery(boolean arg4, ArticleQueryObj articleQueryObj) {
        if((this.isViewValid()) && articleQueryObj != null && articleQueryObj.b == this.d && (arg4)) {
            List v0 = android.support.design.a.a(this.mData, this.mAppData.a(articleQueryObj.q), true);
            this.mListData.c = articleQueryObj.hasMore;
            if(v0.isEmpty()) {
                this.mListData.d = false;
            }

            this.mData.addAll(((Collection)v0));
            this.refreshList();
        }
    }

    public final String getListCategory() {
        return null;
    }

    public final int getListType() {
        return 10;
    }

    public final int getViewLayout() {
        return R.layout.d6;
    }

    public final void onAccountRefresh(boolean arg3, int arg4) {
        if(this.b != null && this.mPullRefreshList != null) {
            this.b.setVisibility(View.GONE);
            this.mPullRefreshList.setVisibility(View.VISIBLE);
        }
    }

    public final void onActivityCreated(Bundle arg3) {
        super.onActivityCreated(arg3);
        this.b.setVisibility(View.GONE);
        this.mPullRefreshList.setVisibility(View.VISIBLE);
    }

    public final void onDeleteFavorClick(CellRef arg1) {
    }

    public final void onEvent(String arg1) {
    }

    public final void onEvent(String arg1, BaseArticle arg2) {
    }

    public final void onResume() {
        super.onResume();
        this.queryData();
    }

    public final void onViewCreated(View view, Bundle bundle) {
        super.onViewCreated(view, bundle);
        this.mFooter.hideFooterContent();
        this.mPullRefreshList.setRefreshing(false);
    }

    public final void queryData() {
        ++this.d;
        long v4 = 0;
        if(!this.mData.isEmpty()) {
            v4 = this.mData.get(this.mData.size() - 1).cateBehotTime;
        }
        new ArticleQueryThread(this.getContext(), this.mArticleQueryHandler, new ArticleQueryObj(this.d, "__all__", v4, "", "")).start();
    }

    public final void refreshListHook() {
        if(this.mData.isEmpty()) {
            this.showNoDataView();
        }
        else {
            this.hideNoDataView();
        }
    }
}

